CommonUtils = {
		javscriptpackage : function(namespace) {
			var seg = namespace.split(".");
			var obj = window[seg[0]] = window[seg[0]] || {};
			var c = obj;
			for ( var i = 1; i < seg.length; i++) {
				c[seg[i]] = c[seg[i]] || {};
				c = c[seg[i]];
			}
			return obj;
		}		
}
var StringBuffer = function(){
	this._strs = new Array();
}
StringBuffer.prototype.append = function(str){
	this._strs.push(str);
	return this;
}
StringBuffer.prototype.toString = function(){
	return this._strs.join("");
}
StringBuffer.prototype.replaceAll  = function(s1,s2){    
	return this.replace(new RegExp(s1,"gm"),s2);    
}
String.prototype.replaceAll  = function(s1,s2){    
	return this.replace(new RegExp(s1,"gm"),s2);    
}  

function trim(str) {
	return str.replace(/(^\s*)|(\s*$)/g, "");
}

function replaceHTMLCode(str){
	return str.replaceAll("<","&lt;").replaceAll(">","&gt;").replaceAll("'","&#39;").replaceAll("\"","&#34;");
}

//是否为数字
function justNumCheck(str) {
	str = trim(str);
	if (!/^[+|-]?\d+\.?\d*$/.test(str)) { //不是数字
		return false;
	}
	return true;
}